package edu.suda.xsap.dto.convert;

import edu.suda.xsap.dto.CardDto;
import edu.suda.xsap.dto.CardTypeDto;
import edu.suda.xsap.entity.Card;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Mapper(componentModel = "spring")
public interface CardConvert {
    @Mapping(source="id", target = "id")
    @Mapping(source="memberName", target = "memberName")
    @Mapping(source="status", target = "status")
    @Mapping(source="totalCount", target = "totalCount")
    @Mapping(source="totalDay", target = "totalDay")
    @Mapping(source="createTime", target = "createTime")
    @Mapping(source="lastModifyTime", target = "lastModifyTime")
    @Mapping(source="cardName", target = "cardName")

    CardDto toDto(Card card);
    List<CardDto> toDtoList(List<Card> cards);

}
